<template>
    <z-paging ref="paging" v-model="recordList" @query="queryList">
        <u-sticky>
            <view class="heqader_box">
                <hedsty :headCentext="'我的房间'"></hedsty>
                <view class="tabs_box">
                    <view class="dange_xuanze_tab_vbox" :class="tabsId == item.id ? 'dange_xuanze_tab_vbox1' : ''"
                        v-for="(item, index) in tabsList" :key="index" @click="tabsBtn(item)">{{ item.text }}
                    </view>
                </view>
            </view>
        </u-sticky>
        <view class="list_box" v-for="(item,index) in recordList" :key="index"
            :style="{ backgroundImage: 'url(' + (tabsId == 1 ? 'https://morgan.dingxians.cn/static/copup/3.png' : 'https://morgan.dingxians.cn/static/copup/3.png') + ')' }">
            <view class="left_box">
                <image :src="item.avatar" mode="scaleToFill" />
            </view>
            <view class="center_box">
                <view class="top_one_bbox">{{ item.name }}</view>
                <view class="top_two_bbox">正品保障 极速提货 满六件包邮</view>
                <view class="top_thr_bbox">{{item.content}}</view>
            </view>
        </view>
    </z-paging>
</template>
<script>
import hedsty from '../../components/hedsty.vue'
export default {
    components: {
        hedsty
    },
    data() {
        return {
            tabsList: [
                {
                    id: 1,
                    text: '进行中'
                },
                {
                    id: 2,
                    text: '已结束'
                }
            ],
            tabsId: 1,
            recordList:[]
        }
    },
    onLoad() {

    },
    onShow() {

    },
    methods: {
        tabsBtn(item) {
            this.tabsId = item.id
			this.$refs.paging.reload()
        },
        queryList(pageNo, pageSize) {
			let data = {
				status: this.tabsId,
				page: pageNo,
				limit: pageSize
			}
			this.$Request.get(this.$api.flw.wealRoomsRecord, data).then(res => {
				if (res.code == 200) {
                    console.log(res)
					this.$refs.paging.complete(res.data.data)
				}
			})
		},
    }
}
</script>
<style lang="scss" scoped>
.heqader_box {
    width: 750rpx;
    height: 447rpx;

    .tabs_box {
        width: 100%;
        height: 50rpx;
        box-sizing: border-box;
        padding-left: 30rpx;
        display: flex;
        justify-content: flex-start;
        margin-top: 32rpx;

        .dange_xuanze_tab_vbox {
            padding: 0 28rpx;
            height: 50rpx;
            text-align: center;
            line-height: 50rpx;
            margin-right: 30rpx;
            background: rgba(255, 255, 255, .5);
            border-radius: 25rpx;
            color: #ccc;
            font-size: 28rpx;

            &.dange_xuanze_tab_vbox1 {
                color: #FF4545;
                background: #501414;

            }
        }


    }
}

.list_box {
    width: 690rpx;
    margin: auto;
    margin-top: -128rpx;
    height: 210rpx;
    background-size: 100% 100%;
    padding: 35rpx 28rpx;
    box-sizing: border-box;
    display: flex;
    justify-content: flex-start;
    position: relative;
    margin-bottom: 168rpx;

    .left_box {
        width: 140rpx;
        height: 140rpx;
        background: #09040A;
        display: flex;
        justify-content: center;
        align-items: center;
        margin-right: 20rpx;

        image {
            width: 140rpx;
            height: 140rpx;
        }
    }

    .center_box {
        height: 140rpx;
        box-sizing: border-box;
        padding-top: 7rpx;

        .top_one_bbox {
            height: 27rpx;
            font-family: PingFang SC;
            font-weight: 500;
            font-size: 28rpx;
            color: #FFFFFF;
            line-height: 27rpx;
            margin-bottom: 26rpx;
        }

        .top_two_bbox {
            width: 272rpx;
            height: 19rpx;
            font-family: PingFang SC;
            font-weight: 500;
            font-size: 20rpx;
            color: #FFFFFF;
            line-height: 19rpx;
            margin-bottom: 26rpx;
        }

        .top_thr_bbox {
            height: 27rpx;
            font-family: PingFang SC;
            font-weight: bold;
            font-size: 32rpx;
            color: #FFEDD7;
        }
    }
}
</style>